package calendar;
import java.util.Calendar;

public class CalendarTest {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();//现在

        //设置日历的时间到出生时间
        calendar.set(1990,0,1,8,8,8);

        //一键转long
        long birthTime = calendar.getTimeInMillis();

        //获取现在时间毫秒值
        long now = System.currentTimeMillis();

        long day = (now - birthTime) / (1000 * 60 * 60 * 24);

        System.out.println("您已经活了"+day+"天! 人的一生大概3万多天,请珍惜生命~");
    }
}
